package cn.itsource.romate.api;

import cn.itsource.pojo.bo.RuleStartBo;
import cn.itsource.pojo.dto.RuleStartDto;
import cn.itsource.pojo.dto.RuleWaitDto;
import cn.itsource.pojo.dto.SharingDto;
import cn.itsource.pojo.vo.SharingVo;
import cn.itsource.result.R;
import cn.itsource.romate.fallback.RuleFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 * 📖：beishan
 * 🗓️：2024/4/10 18:17
 * =====================
 */
@FeignClient(value = "it-fccar-service-rule", fallbackFactory = RuleFallBackFactory.class)
public interface RuleApi {
    /**
     * 起步价 计价规则计算 预付
     * @return
     */
    @PostMapping("/romate/api/rule")
    RuleStartBo ruleStartAdvance(@RequestBody @Valid RuleStartDto ruleStartDto);
    /**
     * 等时费 计价
     */
    @PostMapping("/romate/api/wait")
    R<RuleWaitDto> ruleWait(@RequestParam Long moreData);

    /**
     * 平台抽成
     */
    @PostMapping("/romate/api/sharing")
    R<SharingVo> sharing(@RequestBody  SharingDto sharingDto);


}
